<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
    <script src="/js/jquery-1.7.2.js" type="text/javascript"></script>
    <script type="text/javascript" src="/media/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript" src="/media/js/textareas.js"></script>
    <script type="text/javascript" src="/media/uploadify-new/jquery.uploadify.min.js"></script>
    <link href="/media/uploadify-new/uploadify.css" type="text/css" rel="stylesheet"/>
    <link rel="stylesheet" type="text/css" href="/js/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="/js/css/all.css"/>
    <script type="text/javascript">
        $(function () {
            $("#file_upload_2").uploadify({//文章添加图片， 不存数据库
                height:30,
                swf:'/media/uploadify-new/uploadify.swf',
                uploader:'/upload_script/',
                cancelImage:'/uploadify-new/uploadify-cancel.png',
                buttonClass:'addImg',
                buttonText:'upload img',
                multi:true,
                auto:true,
                width:120,
                onUploadSuccess:function (file, data, response) {
                    var imageHtm = "<img src='{{ url }}media/image/" + data + "'>";
                    //$("#link_fileDiv").html(imageHtm);
                    tinyMCE.execCommand('mceInsertContent', false, imageHtm);
                }
            });
        });
    </script>
    <title>ad</title>


</head>
<body>
<form action="/ad/" method="post">{% csrf_token %}
    {% if ads %}
    {% for ad in ads %}
        <input type="radio" name="id" value='{{ ad.id }}'>分类：{{ ad.category.name }}开始时间：{{ ad.start_date }}
        结束时间：{{ ad.end_date }}预付款：{{ ad.pre_price }}广告费用：{{ ad.price }}
    {% endfor %}
    <table>
        <tr>
            <td><a id="file_upload_2" href="#"></a>
            </td>
        </tr>
        <tr>
            <td><textarea name="content"></textarea></td>
        </tr>
    </table>
    <input type="submit">
    {% else %}
        暂无广告位
    {% endif %}
</form>

</body>
</html>